package com.aaa.ssm.service.impl;

import com.aaa.ssm.dao.SubscribeDao;
import com.aaa.ssm.entity.Subscribe;
import com.aaa.ssm.service.SubscribeService;
import com.aaa.ssm.util.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @author wjz
 * 2023/10/13
 */
@Service
public class SubscribeServiceImpl implements SubscribeService {


    @Resource
    private SubscribeDao subscribeDao;

    /**
     * 挂号 + 添加
     *
     * @param subscribe
     * @return
     */
    @Override
    public int add(Subscribe subscribe) {
        return subscribeDao.add(subscribe);
    }

    @Override
    public PageInfo queryByParam(Page<Subscribe> page) {
        PageHelper.startPage(page.getPageNo(), page.getPageSize());
        return new PageInfo(subscribeDao.selectAll(page.getData()));
    }
    @Override
    public List<Subscribe> selectAll(Subscribe subscribe) {
        return subscribeDao.selectAll(subscribe);
    }


    //前台挂号添加
    @Override
    public int insert(Subscribe subscribe) {
        return subscribeDao.insert(subscribe);
    }

    @Override
    public List<Subscribe> selectById(Integer id) {
        return subscribeDao.selectById(id);
    }

//    @Override
//    public Subscribe selectById(Subscribe subscribe) {
//        return subscribeDao.selectAll(subscribe);
//    }


     // 医生名字
//    @Override
//    public Subscribe selectById(String name) {
//        return subscribeDao.selectById(name);
//    }

    @Override
    public Subscribe querySchedulingInfo(String careerId, String date) {
        return subscribeDao.querySchedulingInfo(careerId,date);
    }


}
